<!doctype html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="expires" content="Wed,26 Jun 2016 08:21:10 GMT">
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
    <meta content="no" name="apple-mobile-web-app-capable" />
    <meta content="black" name="apple-mobile-web-app-status-bar-style" />
    <meta content="telephone=no" name="format-detection" />
    <title>地址列表</title>
    <!--
    <link rel="stylesheet" href="__PUBLIC__/css/reset-mobile.min.css"/>
    <link rel="stylesheet" href="__PUBLIC__/css/style.css"/>
    <link rel="stylesheet" href="__PUBLIC__/css/base.css"/>
    <script src="__PUBLIC__/js/jquery-1.11.1.min.js"></script>
-->
<!-- <link rel="stylesheet" href="http://pocdoc-app.qiniudn.com/reset-mobile.min.css"/> -->
<link rel="stylesheet" href="__PUBLIC__/migrate/css/reset-mobile.min.css"/>
<link rel="stylesheet" href="__PUBLIC__/css/addresslist_style.css"/>
<!-- <link rel="stylesheet" href="http://pocdoc-app.qiniudn.com/base.css"/> -->
<link rel="stylesheet" href="__PUBLIC__/migrate/css/base.css"/>


</head>
<body>
    <div class="se-pre-con"></div>
    <div class='top'>
        <a class='top_left'>
            <img src="__PUBLIC__/images/back.png">
        </a>
        <span class='sub_top_title'>地址列表</span>
        <span class='about'></span>
    </div>
<!--     <div class="nav">
                <ul>
                    <li>

                        <span>选择体检品牌</span>
                        <ul class="sub_ul">
                            <li id="quanbu" title="全部">全部</li>
                            <volist name="dataList" id="data">
                                <li title="{$data->name}">{$data->name}</li>
                            </volist>
                        </ul>
                    </li>
                </ul>
    </div> -->
    <div class='address'>
        <div class="address_list">

            <p class="address_search">
                <input type="text" placeholder="请输入搜索内容"  id="seachs"/>
                <input type="button" class="button" value="搜索" id="button">
            </p>

<!-- 搜索条件开始 -->
            <div  class="wrap">
                <div class="nice-select fal_1" name="nice-select">
                    <input type="text" value="选择品牌" readonly  id="brand_name">
                    <ul>
                        <li data-value="0">选择品牌</li>
                        <li data-value="1">爱康</li>
                        <li data-value="2">慈铭</li>
                        <li data-value="3">美年</li>
                        <!-- <li data-value="4">优和维尔</li> -->
                        <li data-value="5">美兆</li>
                    </ul>
                </div>
                <div class="nice-select  fal_2" name="nice-select">
                    <input type="text" value="选择区域" readonly  id="region_name">
                    <ul>
                        <li data-value="0">选择区域</li>
                        <li data-value="1">东城区</li>
                        <li data-value="2">西城区</li>
                        <li data-value="3">朝阳区</li>
                        <li data-value="4">海淀区</li>
                        <li data-value="5">昌平区</li>
                        <li data-value="6">顺义区</li>
                        <li data-value="7">通州区</li>
                        <li data-value="8">大兴区</li>
                        <li data-value="9">丰台区</li>
                        <li data-value="10">石景山</li>
                        <li data-value="11">房山区</li>
                    </ul>
                </div>
                <div class="nice-select  fal_3" name="nice-select" id = "ts">
                    <input type="text" value="选择范围" readonly  id="scope_name">
                    <ul>
                      <li data-value="0">选择范围</li>
                      <li data-value="1">二环内</li>
                      <li data-value="2">二环至三环</li>
                      <li data-value="3">三环至四环</li>
                      <li data-value="4">四环至五环</li>
                      <li data-value="5">五环外</li>
                    </ul>
                </div>
            </div>
<!-- 搜索条件结束 -->



            <ul class="address_ul">
                <volist name='addressListTuijian' id='tjdata'>
                    <li>
                        <!-- <img src="__PUBLIC__/images/rerseve_unchoosed@2x.png"/> -->
                        <!-- <img src="__PUBLIC__/images/recommended_orange02.png"/> -->
                        <p>
                            <span class="center_name">{$tjdata.name}<img src="__PUBLIC__/images/recommended_orange02.png"/></span><!-- <img src="__PUBLIC__/images/recommended_orange02.png"/> -->
                            <span class="center_address" >{$tjdata.address}</span>
                            <span class="mcbId" style="display: hidden;">{$tjdata.mcbId}</span>
                            <span class="restDay" style="display: none;">{$tjdata.restDay}</span>
                            <span class="tag" style="display: none;">{$tjdata.tag}</span>
                        </p>
                    </li>
                </volist>
                <volist name="addressList" id="data">
                    <li>
                        <!-- <img src="__PUBLIC__/images/rerseve_unchoosed@2x.png"/> -->
                        <!-- <img src="http://pocdoc-app.qiniudn.com/rerseve_unchoosed@2x.png"/> -->
                        <p>
                            <span class="center_name">{$data.name}</span><!-- <img src="__PUBLIC__/images/rerseve_unchoosed@2x.png"/> -->
                            <span class="center_address">{$data.address}</span>
                            <span class="mcbId" style="display: hidden;">{$data.mcbId}</span>
                            <span class="restDay" style="display: none;">{$data.restDay}</span>
                            <span class="tag" style="display: none;">{$data.tag}</span>
                        </p>
                    </li>
                </volist>
            </ul>
        </div>
         <div class="footer">
         <!-- 百度地图1.0 -->
            <!-- <a href="{:U('home/h5api/baiduMap',array('mapInfo'=>$mapInfo,'packageid'=>$_GET['packageid'],'timeShijian'=>$timeShijian))}" id="baiduMap"> -->
        <!-- 百度地图2.0 -->
            <a href="{:U('home/h5api/compatbaidumap',array('mapInfo'=>$mapInfo,'packageid'=>$_GET['packageid'],'timeShijian'=>$timeShijian))}" id="baiduMap">

                <button>查看体检中心地图分布</button>
            </a>
        </div>
    </div>

</body>
<!-- <script  src="http://pocdoc-app.qiniudn.com/jquery-1.11.1.min.js"></script>
页面加载动画js
<script   src="http://cdn.bootcss.com/modernizr/2010.07.06dev/modernizr.min.js"></script> -->

<script src="__PUBLIC__/migrate/js/jquery-1.11.1.min.js"></script>
<script  src="__PUBLIC__/migrate/js/modernizr.min.js"></script>

<script>
    $(document).ready(function(){

        /** 下拉选择开始  **/
            $('[name="nice-select"]').click(function(e){
                $('[name="nice-select"]').find('ul').hide();
                $(this).find('ul').show();
                e.stopPropagation();
            });
            $('[name="nice-select"] li').hover(function(e){
                $(this).toggleClass('on');
                e.stopPropagation();
            });
            $('[name="nice-select"] li').click(function(e){
                var val = $(this).text();
                var dataVal = $(this).attr("data-value");
                $(this).parents('[name="nice-select"]').find('input').val(val);
                $('[name="nice-select"] ul').hide();
                e.stopPropagation();
                searchTiJian();

            });
            $(document).click(function(){
                $('[name="nice-select"] ul').hide();
            });
         /** 下拉选择结束  **/

         /** 失去焦点自动触发搜索 **/
        $("#seachs").blur(function(){
            searchTiJian();
        });

        $(".indicator_list ul li").click(function(){
            $(this).children("ul").slideToggle(250);
            $(this).siblings("ul").slideToggle(250);
        });
        $(".top_left").click(function(){
            history.go(-1);
        });

        $(".address_ul li").on("click",function(){
                //var strimage = "__PUBLIC__/migrate/images/rerseve_choosed.png";
                // console.log(strimage);
                // $(this).find("img").attr("src",strimage);

                $(this).find("p").css("background","#eee");
                // $(this).siblings().find("img").attr("src","http://7nj10u.com1.z0.glb.clouddn.com/rerseve_unchoosed@2x.png");
                var center_name = $(this).find(".center_name").html().split('<')[0];
                var mcbId = $(this).find(".mcbId").html();
                var restDay = $(this).find(".restDay").html();
                var packageid=<?php echo $_GET['packageid'];?>;
                var timeShijian = "{$timeShijian}";
                console.log(timeShijian);
                // console.log(center_name);
                window.location="/yjxtj/h5.php?m=app&a=appointStepSecond&address="+center_name+"&mcbId="+mcbId+"&packageid="+packageid+"&restDay="+restDay+"&timeShijian="+timeShijian; // 生产
                // window.location="/yjxtj/source/h5.php?m=app&a=appointStepSecond&address="+center_name+"&mcbId="+mcbId+"&packageid="+packageid+"&restDay="+restDay+"&timeShijian="+timeShijian;// 本地测试

            });
    });
          //页面加载动画
          $(window).load(function() {
            $(".se-pre-con").fadeOut("slow");;
        });

          // 搜素体检中心
            $("#button").click(function () {
                searchTiJian();
                /** 获取下拉搜索条件开始 **/
                // var brand_name = $('#brand_name').val();
                // var region_name = $('#region_name').val();
                // var scope_name = $('#scope_name').val();
                // if(brand_name =='选择品牌' || brand_name == '所有品牌'){
                //     brand_name = '';
                // }
                // if(region_name == '选择区域' || region_name == '所有区'){
                //     region_name = '';
                // }
                // if(scope_name == '选择范围' || scope_name == '所有'){
                //     scope_name = '';
                // }
                // // console.log('品牌:' + brand_name + ', 大区: ' + region_name + ', 区域:' + scope_name);
                // /** 获取下拉搜索条件结束  **/


                // var list = $(".address_ul li");
                // // console.log(list);

                // var searchVal = $(":text").val().trim();
                // searchVal = searchVal + ' ' + brand_name + ' ' + region_name + ' ' +scope_name;
                // // console.log(searchVal);
                // searchVal = searchVal.split(" ");
                // // console.log(searchVal);
                // for (var i = 0; i < list.length; i++)
                // {
                //     // console.log(list[i].childNodes);
                //     var show_tag=0;
                //     for (var j = 0; j < searchVal.length; j++)
                //     {
                //         // if (list[i].childNodes[5].innerText.indexOf(searchVal[j]) < 0) // 元素隐藏获取不到
                //         if (list[i].childNodes[5].textContent.indexOf(searchVal[j]) < 0)
                //         {
                //             show_tag=0;
                //             break;
                //         }else{
                //             show_tag=1;
                //         }
                //     }
                //     if(show_tag==1){
                //         list[i].style.display = "block";
                //     }else{
                //         list[i].style.display="none";
                //     }
                // }
            });
            // 搜索函数
            function searchTiJian(){
                var brand_name = $('#brand_name').val();
                var region_name = $('#region_name').val();
                var scope_name = $('#scope_name').val();
                if(brand_name =='选择品牌' || brand_name == '所有品牌'){
                    brand_name = '';
                }
                if(region_name == '选择区域' || region_name == '所有区'){
                    region_name = '';
                }
                if(scope_name == '选择范围' || scope_name == '所有'){
                    scope_name = '';
                }
                // console.log('品牌:' + brand_name + ', 大区: ' + region_name + ', 区域:' + scope_name);
                /** 获取下拉搜索条件结束  **/


                var list = $(".address_ul li");
                // console.log(list);

                var searchVal = $(":text").val().trim();
                searchVal = searchVal + ' ' + brand_name + ' ' + region_name + ' ' +scope_name;
                // console.log(searchVal);
                searchVal = searchVal.split(" ");
                // console.log(searchVal);
                for (var i = 0; i < list.length; i++)
                {
                    // console.log(list[i].childNodes);
                    var show_tag=0;
                    for (var j = 0; j < searchVal.length; j++)
                    {
                        // if (list[i].childNodes[5].innerText.indexOf(searchVal[j]) < 0) // 元素隐藏获取不到
                        if (list[i].childNodes[5].textContent.indexOf(searchVal[j]) < 0)
                        {
                            show_tag=0;
                            break;
                        }else{
                            show_tag=1;
                        }
                    }
                    if(show_tag==1){
                        list[i].style.display = "block";
                    }else{
                        list[i].style.display="none";
                    }
                }
            }
                /*
                * 下拉菜单点击隐藏与出现
                * */
                $(".nav ul li").on("touchstart",function(){
                    $(this).find(".sub_ul").slideToggle();
                    $(this).siblings().find(".sub_ul li").fadeOut(100);
                    var liName=$(this).html();
                    $(this).parent().siblings("span").html(liName);
                    return false;
                });

                //选择点击后菜单隐藏
                // $(".sub_ul").on("touchstart",function(){
                //     $(".sub_lu li").fadeOut(100);
                // });

                //页面滚动，隐藏下拉菜单
                $(window).scroll(function(){
                    $(".sub_ul").fadeOut(100);
                });

                //点击其他区域（非下拉菜单区域），下拉菜单隐藏
                $(".nav").siblings().on("touchstart",function(){
                    $(".sub_ul").slideUp();
                });

            //选择体检中心
            $(".sub_ul>li").on("touchstart",function(){
                var list = $(".address_ul li");
                var searchVal = $(this).attr("title").trim();
                searchVal = searchVal.split(" ");
                for (var i = 0; i < list.length; i++)
                {
                    var show_tag=0;
                    for (var j = 0; j < searchVal.length; j++)
                    {
                        if (list[i].childNodes[5].innerText.indexOf(searchVal[j]) < 0)
                        {
                            show_tag=0;
                            break;
                        }else{
                            show_tag=1;
                        }
                    }
                    if(show_tag==1){
                        list[i].style.display = "block";
                    }else{
                        list[i].style.display="none";
                    }
                }
                $(".sub_ul").fadeOut(100);
            });

            $("#quanbu,#meizhao").on("touchstart",function(){
                var list = $(".address_ul li");
                for (var i = 0; i < list.length; i++) {
                    list[i].style.display = "block";
                };
                $(".sub_ul").fadeOut(100);
            });





      </script>

      <html>
